<template>
  <div v-if="show">
    <div class="mask" @click="$emit('close')">
    </div>
    <div class="content" @click="$emit('close')">
      <slot></slot>
    </div>
  </div>
</template>

<script>
  export default {
    name: "image-viewer",
    data(){
      return{

      }
    },
    props:{
      show:{
        type:Boolean,
        default:false
      }

    }
  }
</script>

<style scoped>
  .mask {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(50, 50, 50, .5);
    z-index: 998;
  }

  .content {
    width: 100%;
    position: fixed;
    left: 0;
    top: 50%;
    z-index: 999;
    transform: translateY(-50%);
  }

</style>
